/**
 * Created by nengjian on 2017/5/18.
 */
var co = require('co'),

    _ctx = require("../../extend/context"),
    _posts = require("../../service/getDate/posts"),
    pipeline = require('../../utils/pipeline'),
    wxingBookshelf = require('../../models');

function* findAll() {
    function doQuery(options) {
        return wxingBookshelf.Post.forge().fetchAll();
    }

    return pipeline([doQuery], {}).then(function formatResponse(result) {
        if (result) {
            return result.toJSON();
        }
    })
}
module.exports = {
    article:function (options) {
        // yield any promise
        return co(function *() {
            var result = yield findAll();
            return result;
        });
    }
}